package com.bwie.controller;

import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Title:
 * @BelongProjecet month0617
 * @BelongPackage com.bwie.controller
 * @Description:
 * @Copyright 研发一部
 * @Author: Mr.yan
 * @Date: 2024/6/17 9:34
 * @Version V1.0
 */
@RestController
@RequestMapping(value = "/user/user")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * @Description: //获取手机验证码
     * @Auther: yanxingru
     * @Date: 2024/6/17 9:36
     * @param:
     * @param mobile
     * @return com.bwie.utils.R
     */
    @PostMapping("/sendCode/{mobile}")
    public R sendCode(
            @PathVariable String mobile
    ){
        return userService.sendCode(mobile);
    }

    /**
     * @Description: //用户登录
     * @Auther: yanxingru
     * @Date: 2024/6/17 9:41
     * @param:
     * @param loginVo
     * @return com.bwie.utils.R
     */
    @PostMapping("/userLogin")
    public R userLogin(
            @RequestBody LoginVo loginVo
            ){
        return userService.userLogin(loginVo);
    }
    /**
     * @Description: //忘记密码找回密码
     * @Auther: yanxingru
     * @Date: 2024/6/17 9:44
     * @param:
     * @param loginVo
     * @return com.bwie.utils.R
     */
    @PostMapping("/forgetPassword")
    public R forgetPassword(
            @RequestBody LoginVo loginVo
    ){
        return userService.forgetPassword(loginVo);
    }




}
